import Mock from 'mockjs'

const generateModels = () => ({
  model_id: Mock.Random.integer(1, 100),
  model_name: Mock.Random.pick([
    '0.pth',
    'densenet121.pth',
    'googlenet.pth',
    'model_result_BloodMNIST.pth',
    'model_result_BreastMNIST.pth',
    'model_result_DermaMNIST.pth',
    'model_result_OCTMNIST.pth',
    'model_result_OrganAMNIST.pth',
    'model_result_PathMNIST.pth',
    'model_result_PneumoniaMNIST.pth',
    'model_result_RetinaMNIST.pth',
    'model_result_TissueMNIST.pth',
    'mymodel_best.pth',
    'mytest_best.pth',
    'resnet18.pth',
    'resnet50.pth',
    'testbest.pth',
    'test_best.pth',
    'vgg16.pth',
  ]),
  model_type: Mock.Random.pick([
    'resnet18',
    'resnet50',
    'densenet121',
    'alexnet',
    'vgg16',
    'vgg19',
    'inception_v3',
    'googlenet',
  ]),
  model_protect: Mock.Random.pick(['标准模式', '差分隐私', 'XNegDL', 'PPUTL', '共享权重', '同态加密']),
  model_describe: Mock.Random.csentence(10, 30),
})

const models = []

for (let i = 0; i < 20; i++) {
  models.push(generateModels())
}

const pagination = {
  page: 1,
  perpage: 10,
  total: 30,
}

const modelget = [
  // 项目
  {
    url: '/got_model_manage',
    type: 'get',
    response: (config) => {
      console.log(config)
      console.log(models)
      return {
        code: 200,
        data: models,
        pagination,
      }
    },
  },
  {
    url: '/upload_model',
    type: 'post',
    response: (config) => {
      console.log(config)
      return {
        code: 200,
        data: 'success',
      }
    },
  },
]

export default modelget
